package com.appspot.yeswether;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION) 
public class Weather {

    @PrimaryKey 
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) 
    private Key key; 
    
    @Persistent
    private String dateString;
    
    @Persistent
    private long scrapTime;
    
    @Persistent
    private String regionCode;
    
    @Persistent
    private String regionName;
    
    @Persistent
    private String morningImg;
    
    @Persistent
    private String morningTxt;
    
    @Persistent
    private String morningTemp;
    
    @Persistent
    private String morningRainPercent;
    
    @Persistent
    private String eveningImg;
    
    @Persistent
    private String eveningTxt;
    
    @Persistent
    private String eveningTemp;
    
    @Persistent
    private String enveningRainPercent;

    @Persistent
    private String tmorningImg;
    
    @Persistent
    private String tmorningTxt;
    
    @Persistent
    private String tmorningTemp;
    
    @Persistent
    private String tmorningRainPercent;
    
    @Persistent
    private String teveningImg;
    
    @Persistent
    private String teveningTxt;
    
    @Persistent
    private String teveningTemp;
    
    @Persistent
    private String tenveningRainPercent;
    
	public String getDateString() {
		return dateString;
	}

	public void setDateString(String dateString) {
		this.dateString = dateString;
	}

	public Key getKey() {
		return key;
	}

	public void setKey(Key key) {
		this.key = key;
	}

	public String getRegionCode() {
		return regionCode;
	}

	public void setRegionCode(String regionCode) {
		this.regionCode = regionCode;
	}

	public String getRegionName() {
		return regionName;
	}

	public void setRegionName(String regionName) {
		this.regionName = regionName;
	}

	public String getMorningImg() {
		return morningImg;
	}

	public void setMorningImg(String morningImg) {
		this.morningImg = morningImg;
	}

	public String getMorningTxt() {
		return morningTxt;
	}

	public void setMorningTxt(String morningTxt) {
		this.morningTxt = morningTxt;
	}

	public String getMorningTemp() {
		return morningTemp;
	}

	public void setMorningTemp(String morningTemp) {
		this.morningTemp = morningTemp;
	}

	public String getMorningRainPercent() {
		return morningRainPercent;
	}

	public void setMorningRainPercent(String morningRainPercent) {
		this.morningRainPercent = morningRainPercent;
	}

	public String getEveningImg() {
		return eveningImg;
	}

	public void setEveningImg(String eveningImg) {
		this.eveningImg = eveningImg;
	}

	public String getEveningTxt() {
		return eveningTxt;
	}

	public void setEveningTxt(String eveningTxt) {
		this.eveningTxt = eveningTxt;
	}

	public String getEveningTemp() {
		return eveningTemp;
	}

	public void setEveningTemp(String eveningTemp) {
		this.eveningTemp = eveningTemp;
	}

	public String getEnveningRainPercent() {
		return enveningRainPercent;
	}

	public void setEnveningRainPercent(String enveningRainPercent) {
		this.enveningRainPercent = enveningRainPercent;
	}

	public String getTmorningImg() {
		return tmorningImg;
	}

	public void setTmorningImg(String tmorningImg) {
		this.tmorningImg = tmorningImg;
	}

	public String getTmorningTxt() {
		return tmorningTxt;
	}

	public void setTmorningTxt(String tmorningTxt) {
		this.tmorningTxt = tmorningTxt;
	}

	public String getTmorningTemp() {
		return tmorningTemp;
	}

	public void setTmorningTemp(String tmorningTemp) {
		this.tmorningTemp = tmorningTemp;
	}

	public String getTmorningRainPercent() {
		return tmorningRainPercent;
	}

	public void setTmorningRainPercent(String tmorningRainPercent) {
		this.tmorningRainPercent = tmorningRainPercent;
	}

	public String getTeveningImg() {
		return teveningImg;
	}

	public void setTeveningImg(String teveningImg) {
		this.teveningImg = teveningImg;
	}

	public String getTeveningTxt() {
		return teveningTxt;
	}

	public void setTeveningTxt(String teveningTxt) {
		this.teveningTxt = teveningTxt;
	}

	public String getTeveningTemp() {
		return teveningTemp;
	}

	public void setTeveningTemp(String teveningTemp) {
		this.teveningTemp = teveningTemp;
	}

	public String getTenveningRainPercent() {
		return tenveningRainPercent;
	}

	public void setTenveningRainPercent(String tenveningRainPercent) {
		this.tenveningRainPercent = tenveningRainPercent;
	}
	
	
	public long getScrapTime() {
		return scrapTime;
	}

	public void setScrapTime(long scrapTime) {
		this.scrapTime = scrapTime;
	}

	public boolean isValid(){
		if(this.regionCode==null) return false;
		if(this.dateString == null) return false;
		if(this.morningImg == null) return false;
		if(this.morningTemp ==null) return false;
		if(this.morningTxt== null) return false;
		if(this.eveningImg == null) return false;
		if(this.eveningTemp==null) return false;
		if(this.eveningTxt ==null) return false;
		if(this.teveningImg  ==null) return false;
		return true;
	}

	@Override
	public String toString() {
		return "Weather [key=" + key + ", dateString=" + dateString
				+ ", scrapTime=" + scrapTime + ", regionCode=" + regionCode
				+ ", regionName=" + regionName + ", morningImg=" + morningImg
				+ ", morningTxt=" + morningTxt + ", morningTemp=" + morningTemp
				+ ", morningRainPercent=" + morningRainPercent
				+ ", eveningImg=" + eveningImg + ", eveningTxt=" + eveningTxt
				+ ", eveningTemp=" + eveningTemp + ", enveningRainPercent="
				+ enveningRainPercent + ", tmorningImg=" + tmorningImg
				+ ", tmorningTxt=" + tmorningTxt + ", tmorningTemp="
				+ tmorningTemp + ", tmorningRainPercent=" + tmorningRainPercent
				+ ", teveningImg=" + teveningImg + ", teveningTxt="
				+ teveningTxt + ", teveningTemp=" + teveningTemp
				+ ", tenveningRainPercent=" + tenveningRainPercent + "]";
	}
	
	
    
}
